<?php
use yii\helpers\Url;

$web = Url::base();

$this->title = '卡片选择';
?>

<link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall-m/card-select.css"/>

<style type="text/css">
    .shop-select {
        background: url(<?= $web ?>/images/mall-m/shop-background.png) no-repeat;
        background-size: cover;
    }

    .into-btn {
        -webkit-mask: url(<?= $web ?>/images/mall-m/shop-mask.png);
        -webkit-mask-size: cover;
    }

    .heade .title {
        background: url(<?= $web ?>/images/mall-m/scan-title-bg.png) no-repeat;
        background-size: cover;
    }

    .dora-card .title {
        background: url(<?= $web ?>/images/mall-m/scan-dora1-bg.png) no-repeat;
        background-size: cover;
    }

    .dora-block .title {
        background: url(<?= $web ?>/images/mall-m/scan-dora-bg2.png) no-repeat;
        background-size: cover;
    }
</style>

<div class="main">
    <?php
    if (count($items) > 0) {
        foreach ($items as $item) {
            ?>
            <div class="shop-select">
                <div class="name">
                    <img class="f-l" src="<?= $web ?>/images/mall-m/shop-title.png"/>
                    <p class="f-l"><?= $item['name'] ?></p>
                </div>
                <div class="institution">
                    <img class="f-l" src="<?= $web ?>/images/mall-m/shop-content.png"/>
                    <p class="f-l"><?= $item['institution_name'] ?></p>
                </div>
                <div class="timer">
                    <img class="f-l" src="<?= $web ?>/images/mall-m/shop-time.png"/>
                    <p class="f-l">使用时间：<span><?= date('Y-m-d', strtotime($item['create_datetime'])) ?></span></p>
                </div>
                <a href="index?institution_code=<?= $item['institution_code'] ?>">
                    <p class="into-btn">进入商城</p>
                </a>
            </div>
            <?php
        }
    } else {
        ?>
        <div class="none-card">
            <div class="heade">
                <img src="<?= $web ?>/images/mall-m/scan-dora-img.jpg"/>
                <p class="title">
                    请打开微信扫一扫
                </p>
            </div>
            <div class="dora-card">
                <p class="title">朵拉名片上的二维扫码</p>
                <div class="card-img">
                    <img src="<?= $web ?>/images/mall-m/scan-dora-img1.png"/>
                    <img src="<?= $web ?>/images/mall-m/scan-dora-img2.png"/>
                </div>
            </div>
            <div class="or">
                <img src="<?= $web ?>/images/mall-m/scan-icon.png"/>
            </div>
            <div class="dora-block">
                <p class="title">朵拉名片上的二维扫码</p>
                <div class="card-img">
                    <img src="<?= $web ?>/images/mall-m/scan-dora-img3.png"/>
                    <img src="<?= $web ?>/images/mall-m/scan-dora-img4.png"/>
                </div>
            </div>
        </div>
        <?php
    }
    ?>
</div>
